﻿using System;
using System.Collections.Generic;

namespace Xman.EventBus
{
    /// <summary>
    /// Event's base class
    /// </summary>
    public abstract class Event
    {
        /// <summary>
        /// Event sender
        /// </summary>
        public object Source { get; private set; }

        public string EventID { get; set; }
        /// <summary>
        /// Context
        /// </summary>
        public Dictionary<string, object> Context { get; private set; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="source">event sender</param>
        public Event(object source)
        {
            Source = source ?? throw new ArgumentNullException(nameof(source));
            Context = new Dictionary<string, object>();
            EventID = Guid.NewGuid().ToString();
        }
    }
}
